<?php
define('BASE_PATH', dirname(__FILE__));
define('APPLICATION_PATH', BASE_PATH . '/application');
define('WEB_PATH', BASE_PATH);
define('PRODUCT_IMG_UPLOAD_PATH', WEB_PATH."/images/products/");

// dinh nghia duong dan application , co the thay doi neu ko thich dung application
defined('APPLICATION_PATH')
	|| define('APPLICATION_PATH', realpath(dirname(__FILE__).'/application'));
//dinh nghia enviroment
defined('APPLICATION_ENV')
	|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV')? getenv('APPLICATION_ENV'):'production'));
// duong dan thu vien Zend
set_include_path(implode(PATH_SEPARATOR, array(
	realpath(APPLICATION_PATH.'/../library'),
	get_include_path(),
	)));
// include Zend 
require_once 'Zend/Application.php';
// khoi tao application , bootstrap and run
$environment = APPLICATION_ENV;
$options = APPLICATION_PATH . '/configs/application.ini';
$application = new Zend_Application($environment, $options);
$application->bootstrap()->run();